package com.bianqian.demo.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 笔记DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteDto {
    
    private Long id;
    
    private Long userId;
    
    private Long categoryId;
    
    private String categoryName;
    
    @NotBlank(message = "笔记标题不能为空")
    @Size(min = 1, max = 200, message = "笔记标题长度必须在1-200个字符之间")
    private String title;
    
    private String content;
    
    private Boolean isFavorite;
    
    private Boolean isPinned;
    
    private Boolean isEncrypted;
    
    private LocalDateTime encryptedTime;
    
    private LocalDateTime createdAt;
    
    private LocalDateTime updatedAt;
    
    // 用于前端显示的格式化时间
    private String date;
}





